package read;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        CardDemo cardDemo = new CardDemo();
        List<Crad> deck = CardDemo.buyDeck();
        System.out.println(deck);
        System.out.println("=====");
        cardDemo.shuffle(deck);
        System.out.println("洗牌后");
        System.out.println(deck);
        List<List<Crad>> hands = new ArrayList<>();
        List<Crad> hand1 = new ArrayList<>();
        List<Crad> hand2 = new ArrayList<>();
        List<Crad> hand3 = new ArrayList<>();
        hands.add(hand1);
        hands.add(hand2);
        hands.add(hand3);

        for(int i = 0;i < 5;i++) {
            for(int j = 0;j < 3;j++) {
                Crad crad = deck.remove(0);
                hands.get(j).add(crad);
            }
        }

        System.out.println("剩余的牌:");
        System.out.println(deck);
        System.out.println("A 手中的牌:");
        System.out.println(hands.get(0));
        System.out.println("B 手中的牌:");
        System.out.println(hands.get(1));
        System.out.println("C 手中的牌:");
        System.out.println(hands.get(2));

    }
}
